<%--
  Created by IntelliJ IDEA.
  User: mojiajing
  Date: 2011-7-1
  Time: 16:43:15
  Desc: 
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/pages/inc/taglibs.jsp" %>
<%@ include file="/WEB-INF/pages/inc/nocache.jsp" %>
<%@ include file="/WEB-INF/pages/inc/meta.jsp" %>
<html>
<head>
    <title>注册</title>
    <script type="text/javascript" src="/js/jquery.js"></script>
    <script src="/js/jquery-validation/jquery.validate.js" type="text/javascript"></script>
    <script src="/js/jquery-validation/additional-methods.js" type="text/javascript"></script>
    <script src="/js/jquery-validation/messages_cn.js" type="text/javascript"></script>
    <script type="text/javascript">
        var checkFlg = false;
        $().ready(function() {
            $("#registerForm").validate({
                rules: {
                    userName: {
                        required:true
                    },
                    realName:"required",
                    email: {
                        required: true,
                        email: true
                    },
                    userPassword: {
                        required: true,
                        minlength: 6
                    },
                    confirmPassword: {
                        required: true,
                        minlength: 6,
                        equalTo: "#userPassword"
                    },
                    groupNo:{
                        required: true,
                        minlength: 3,
                        maxlength:3,
                        digits:true
                    } ,
                    memberNo:{
                        required: true,
                        minlength: 2,
                        maxlength:2 ,
                        digits:true
                    },
                    phone:{
                        minlength:11,
                        maxlength:11,
                        digits:true
                    }
                },
                messages: {
                    email: {
                        email: "邮箱格式不正确"
                    },
                    userPassword: {
                        minlength: jQuery.format("不能小于{0}个位")
                    },
                    confirmPassword: {
                        minlength:jQuery.format("不能小于{0}个位"),
                        equalTo: "两次输入密码不一致"
                    } ,
                    groupNo:{
                        minlength: jQuery.format("不能小于{0}个位"),
                        maxlength:jQuery.format("不能大于{0}个位"),
                        digits:"格式不正确"
                    } ,
                    memberNo:{
                        minlength: jQuery.format("不能小于{0}个位"),
                        maxlength:jQuery.format("不能大于{0}个位"),
                        digits:"格式不正确"
                    },
                    phone:{
                        minlength:jQuery.format("不能小于{0}个位"),
                        maxlength:jQuery.format("不能大于{0}个位"),
                        digits:"格式不正确"
                    }
                }
            });
        })
    </script>
    <style type="text/css">
        #field, label {
            font-family: Arial, Helvetica, sans-serif;
            font-size: small;
        }

        input.submit {
            float: none;
        }

        label.error {
            padding-left: 5px;
            margin-left: .3em;
            color: red;
        }
    </style>
</head>
<body>
<div style="color: red;">${error}</div>
<form id="registerForm" action="${ctx}/user/userRegist.aspx" method="post">
    <table>
        <tr>
            <td align="right">用户名：</td>
            <td><input type="text" id="userName" name="userName" value="${userRegisterCommand.userName}" size="25" ></td>
        </tr>
        <tr>
            <td align="right">真实姓名：</td>
            <td><input type="text" name="realName" value="${userRegisterCommand.realName}" size="25"></td>
        </tr>
        <tr>
            <td align="right">密码：</td>
            <td><input id="userPassword" type="password" name="userPassword" size="25"></td>
        </tr>
        <tr>
            <td align="right">确认密码：</td>
            <td><input type="password" name="confirmPassword" size="25"></td>
        </tr> 
        <tr>
            <td align="right">电子邮箱：</td>
            <td><input type="text" name="email" value="${userRegisterCommand.email}" size="25"></td>
        </tr>
        <tr>
            <td align="right">手机号：</td>
            <td><input type="text" name="phone" value="${userRegisterCommand.phone}" size="25"></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" value="提交"></td>
        </tr>
    </table>
</form>
</body>
</html>